/* Copyright (c) 2025 LiuZiyao
*    Key Laboratory of Cyberspace Security Defense,Institute of Information Engineering, CAS
*    School of Cyber Security, University of Chinese Academy of Sciences     
*
* This file is part of the openHiTLS project.
*
* openHiTLS is licensed under the Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
*
*     http://license.coscl.org.cn/MulanPSL2
*
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
*/

#include <stdint.h>

//polar parameter struct
struct polar_control {
	unsigned int    N; // code length
	unsigned int    n; // log2(N)
	unsigned int    K; // message length
	unsigned int    ecc_bytes; // N/8
};
//polar encode
void encode_polar(uint8_t *u);
//polar decode
void decode_polar(uint8_t *m_cap, const double *llr);



